import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'

import User from './views/User.vue'
import UserEdit from './views/UserEdit.vue'
import Login from './views/Login.vue'
import Register from './views/Register.vue'

import Type from './views/Type.vue'
import Article from './views/Article.vue'
import SendNote from './views/SendNote.vue'
import Select from './views/Select.vue'

import error404 from '@/components/404.vue'
Vue.use(Router)

export default new Router({
  routes: [{
    path: '/',
    name: 'index',
    component: Home,
  }, {
    path: '/user/edit',
    name: 'useredit',
    component: UserEdit,
  }, {
    path: '/user/login',
    name: 'login',
    component: Login,
  }, {
    path: '/user/register',
    name: 'register',
    component: Register,
  }, {
    path: '/user/:id',
    name: 'user',
    component: User,
  }, {
    path: '/type/:id',
    name: 'type',
    component: Type,
  }, {
    path: '/article/:id',
    name: 'article',
    component: Article,
  }, {
    path: '/select/:key',
    name: 'select',
    component: Select,
  }, {
    path: '/note/new',
    name: 'createnote',
    component: SendNote
  }, {
    path: '*',
    name: '404',
    component: error404,
  }]
})